"use strict"

/**
 * 北京市经信委基金爬虫
 *  
 */

var Base = require("./base");
var jjhxx_spider = new Base();
jjhxx_spider.name = "北京市经信委";

jjhxx_spider.getPageUrl = function(pg) {
    var url = "http://www.bjeit.gov.cn/jxdt/tzgg/index.htm"
    if(pg != 1){
        url = "http://www.bjeit.gov.cn/jxdt/tzgg/index" + (pg - 1)+".htm";
    }
    return url;
};

jjhxx_spider.getItems = function($) {
    var items = [];
    $(".xxk_txt li a").each(function(index, ele) {
        var e = $(ele);
        var item = {};
        item.title = e.text().substring(12);
        item.url = "http://www.bjeit.gov.cn/jxdt/tzgg/" + e.attr("href");
        item.source = jjhxx_spider.name;
        items.push(item);
    });
    return items;
};

exports = module.exports = jjhxx_spider;